/**
 * Generate code from /{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/domain/{{entities@NONE}}.java.hbs
 */
package cn.ibizlab.core.authentication.domain;

import java.util.*;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.util.*;
import org.springframework.data.annotation.*;
import cn.ibizlab.util.annotation.*;
import cn.ibizlab.util.enums.*;
import cn.ibizlab.util.domain.IEntity;
import cn.ibizlab.util.domain.EntityBase;
import java.io.Serializable;
import lombok.*;
import lombok.experimental.Accessors;
import io.swagger.annotations.*;

/**
 * 认证信息实体类[AuthInfo]
 *
 * @author generator
 */
@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
@JsonIgnoreProperties(value = "handler")
@ApiModel(value = "AUTH_INFO", description = "认证信息")
public class AuthInfo extends EntityBase implements Serializable
{

    /**
     * 用户标识
     */
    @Id
    @DEField(name = "id" , isKeyField = true)
    @JsonProperty("id")
    @JSONField(name = "id")
    @ApiModelProperty(value = "id", notes = "用户标识")
    private String id;

    /**
     * 用户显示名
     */
    @DEField(name = "display_name")
    @JsonProperty("display_name")
    @JSONField(name = "display_name")
    @ApiModelProperty(value = "display_name", notes = "用户显示名")
    private String displayName;

    /**
     * username/uid
     */
    @DEField(name = "username")
    @JsonProperty("username")
    @JSONField(name = "username")
    @ApiModelProperty(value = "username", notes = "username/uid")
    private String username;

    /**
     * DC
     */
    @DEField(name = "dc")
    @JsonProperty("dc")
    @JSONField(name = "dc")
    @ApiModelProperty(value = "dc", notes = "DC")
    private String dc;

    /**
     * 组织机构标识
     */
    @DEField(name = "organization_id")
    @JsonProperty("organization_id")
    @JSONField(name = "organization_id")
    @ApiModelProperty(value = "organization_id", notes = "组织机构标识")
    private String organizationId;

    /**
     * 电子邮箱
     */
    @DEField(name = "mail")
    @JsonProperty("mail")
    @JSONField(name = "mail")
    @ApiModelProperty(value = "mail", notes = "电子邮箱")
    private String mail;

    /**
     * 移动电话
     */
    @DEField(name = "mobile")
    @JsonProperty("mobile")
    @JSONField(name = "mobile")
    @ApiModelProperty(value = "mobile", notes = "移动电话")
    private String mobile;

    /**
     * 头像
     */
    @DEField(name = "avatar")
    @JsonProperty("avatar")
    @JSONField(name = "avatar")
    @ApiModelProperty(value = "avatar", notes = "头像")
    private String avatar;

    /**
     * 隶属于
     */
    @DEField(name = "member_of")
    @JsonProperty("member_of")
    @JSONField(name = "member_of")
    @ApiModelProperty(value = "member_of", notes = "隶属于")
    private List<AuthMember> memberOf;

    /**
     * 授予
     */
    @DEField(name = "grants")
    @JsonProperty("grants")
    @JSONField(name = "grants")
    @ApiModelProperty(value = "grants", notes = "授予")
    private List<AuthGrantedSystem> grants;

    /**
     * 人员编号
     */
    @DEField(name = "employee_number" , dupCheck = DupCheck.ALL)
    @JsonProperty("employee_number")
    @JSONField(name = "employee_number")
    @ApiModelProperty(value = "employee_number", notes = "人员编号")
    private String employeeNumber;

    /**
     * 类型
     */
    @DEField(name = "employee_type")
    @JsonProperty("employee_type")
    @JSONField(name = "employee_type")
    @ApiModelProperty(value = "employee_type", notes = "类型")
    private String employeeType;

    /**
     * 职位
     */
    @DEField(name = "title")
    @JsonProperty("title")
    @JSONField(name = "title")
    @ApiModelProperty(value = "title", notes = "职位")
    private String title;

    /**
     * 联系电话
     */
    @DEField(name = "telephone_number")
    @JsonProperty("telephone_number")
    @JSONField(name = "telephone_number")
    @ApiModelProperty(value = "telephone_number", notes = "联系电话")
    private String telephoneNumber;

    /**
     * 证件号
     */
    @DEField(name = "identification_number")
    @JsonProperty("identification_number")
    @JSONField(name = "identification_number")
    @ApiModelProperty(value = "identification_number", notes = "证件号")
    private String identificationNumber;

    /**
     * 地址
     */
    @DEField(name = "postal_address")
    @JsonProperty("postal_address")
    @JSONField(name = "postal_address")
    @ApiModelProperty(value = "postal_address", notes = "地址")
    private String postalAddress;


    /**
     * 复制当前对象数据到目标对象(粘贴重置)
     * @param targetEntity 目标数据对象
     * @param includeEmpty  是否包括空值
     * @param <T>
     * @return
     */
    @Override
    public <T> T pasteTo(T targetEntity, boolean includeEmpty) {
        super.pasteTo(targetEntity, includeEmpty);
        if(targetEntity instanceof IEntity) {
            IEntity entity = ((IEntity) targetEntity);
            entity.reset("id");
        }
        return targetEntity;
    }

}